package com.springboot.love.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;

/**
 * (Post)实体类
 */
@ToString
public class Post implements Serializable {
    private static final long serialVersionUID = -29317690046775787L;
    /**
    * 帖子id
    */
    @Setter
    @Getter
    @TableId(value = "post_id", type = IdType.AUTO)
    private Integer postId;
    /**
    * 用户id
    */
    @Setter
    @Getter
    @TableField(value = "user_id")
    private Integer userId;
    /**
    * 帖子类型
    * 0:匿名表白; 1:公开表白; 2:分享; 3:吐槽
    */
    @Setter
    @Getter
    @TableField(value = "post_type")
    private Byte postType;
    /**
    * 帖子摘要
    */
    @Setter
    @Getter
    @TableField(value = "post_abstract")
    private String postAbstract;
    /**
    * 帖子内容
    */
    @Setter
    @Getter
    @TableField(value = "post_content")
    private String postContent;
    /**
    * 帖子访问数
    */
    @Setter
    @Getter
    @TableField(value = "post_visited_count")
    private Integer postVisitedCount;
    /**
    * 回复数
    */
    @Setter
    @Getter
    @TableField(value = "answer_count")
    private Integer answerCount;
    /**
    * 帖子被赞次数
    */
    @Setter
    @Getter
    @TableField(value = "post_liked_count")
    private Integer postLikedCount;
    /**
    * 帖子状态
    * 1:正常 2:封禁 3:删除
    */
    @Setter
    @Getter
    @TableField(value = "post_state")
    private Byte postState;
    /**
    * 帖子创建时间
    */
    @Setter
    @Getter
    @TableField(value = "post_create_time")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date postCreateTime;
}